import type { RouteRecordRaw } from 'vue-router'
const login = () => import('@pages/Login/index.vue')
const container = () => import('@layout/index.vue')
const a404 = () => import('@pages/404/index.vue')

//定义常量公共路由
const constantRoute: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/main',
  },
  {
    //登录路由
    path: '/login',
    component: login,
    name: 'login',
  },
  {
    //登录成功展示数据路由
    path: '/main',
    component: container,
    name: 'layout',
  },
  {
    //404路由
    path: '/404',
    component: a404,
    name: '404',
  },
  {
    //任意路由到404
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
  },
]

export { constantRoute }
